package com.server.pinggu.service.impl;

import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.commons.lang3.StringUtils;
import com.server.pinggu.mapper.SenWxNoticeMapper;
import com.server.pinggu.domain.SenWxNotice;
import com.server.pinggu.service.ISenWxNoticeService;

import java.util.List;

/**
 * 【请填写功能名称】Service业务层处理
 *
 * @author ltao
 * @date 2022-10-23
 */
@Service
public class SenWxNoticeServiceImpl extends ServiceImpl<SenWxNoticeMapper, SenWxNotice> implements ISenWxNoticeService {

    @Override
    public List<SenWxNotice> queryList(SenWxNotice senWxNotice) {
        LambdaQueryWrapper<SenWxNotice> lqw = Wrappers.lambdaQuery();
        if (senWxNotice.getUid() != null){
            lqw.eq(SenWxNotice::getUid ,senWxNotice.getUid());
        }
        if (StringUtils.isNotBlank(senWxNotice.getTag())){
            lqw.eq(SenWxNotice::getTag ,senWxNotice.getTag());
        }
        if (senWxNotice.getStatus() != null){
            lqw.eq(SenWxNotice::getStatus ,senWxNotice.getStatus());
        }
        if (StringUtils.isNotBlank(senWxNotice.getData())){
            lqw.eq(SenWxNotice::getData ,senWxNotice.getData());
        }
        if (senWxNotice.getDtime() != null){
            lqw.eq(SenWxNotice::getDtime ,senWxNotice.getDtime());
        }
        if (senWxNotice.getPriority() != null){
            lqw.eq(SenWxNotice::getPriority ,senWxNotice.getPriority());
        }
        if (StringUtils.isNotBlank(senWxNotice.getWxrs())){
            lqw.eq(SenWxNotice::getWxrs ,senWxNotice.getWxrs());
        }
        if (senWxNotice.getTp() != null){
            lqw.eq(SenWxNotice::getTp ,senWxNotice.getTp());
        }
        return this.list(lqw);
    }
}